/**
 * Created by xingkaihang on 2016/11/28.
 */
'use strict'

import React from 'react'
import { Button, Alert, message} from 'antd'
import Page from '../../../base/Page'
import * as layout from '../../../configs/layout'
import ajax from '../../../utilities/ajax'


export default class PageButton extends Page {
    constructor(props) {
        super(props)
        this.handleAcceptBtnClick = this.handleAcceptBtnClick.bind(this)
    }

    handleAcceptBtnClick(){
        //message.info('This is a normal message');
        //message.success('This is a message of success');
        //message.error('This is a message of error');
        //message.warning('This is message of warning');
        ajax.getJSON('http://fwz.y.dingdongxiaoqu.com/delivery/busyHour/getRecord?taskId=61123000208&record_id=&current_taskId=',{},{
            cors: true,
            onSuccess: function(){
                message.success('This is a message of success');
            },
            onError: function(){
                message.error('This is a message of error');
            }
        })
    }

    render() {
        return (
            <div>
                <h1>antd按钮组件</h1>
                <Alert message="Success Tips" type="success" showIcon />
                <Alert message="Informational Notes" type="info" showIcon />
                <Button type="primary" onClick={this.handleAcceptBtnClick}>Display normal message</Button>
            </div>
        )
    }
}

PageButton.defaultProps = {
    title: '按钮组件'
}